package ccrClasses.layer2;

import ccrClasses.ICcr;

public class Dose implements ICcr {
	
	public final static String OPEN_TAG = "<Dose>";

	public final static String CLOSE_TAG = "</Dose>";
	
	private Value value;
	
	private Units units;
	
	public Dose(Value value, Units units) {
		super();
		this.value = value;
		this.units = units;
	}
	
	public Dose(Value value) {
		super();
		this.value = value;
	}
	
	public Dose(Units units) {
		super();
		this.units = units;
	}

	/**
	 * @return the value
	 */
	public Value getValue() {
		return value;
	}

	/**
	 * @param value the value to set
	 */
	public void setValue(Value value) {
		this.value = value;
	}

	/**
	 * @return the units
	 */
	public Units getUnits() {
		return units;
	}

	/**
	 * @param units the units to set
	 */
	public void setUnits(Units units) {
		this.units = units;
	}

	@Override
	public String constructCcrString() {
		String ccrDose = OPEN_TAG;
		if(value != null){
			ccrDose += value.constructCcrString();
		}
		
		if(units != null){
			ccrDose += units.constructCcrString();
		}
		
		ccrDose += CLOSE_TAG;
		return ccrDose;
	}

}
